package com.david.zhufengfm.entity.discoverrecommend;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by David on 2015/10/21.
 * qq:978944820
 */
public class DiscoverRecommendSpecial extends DiscoverRecommendItem{
    private int ret;
    private List<SpecialRecommend> specialRecommends;
    public void parseJSON(JSONObject json) throws JSONException {
        super.parseJson(json);
        ret=json.getInt("ret");
        JSONArray jsonArray=json.getJSONArray("list");
        specialRecommends=new LinkedList<>();
        for (int i = 0; i < jsonArray.length(); i++) {
            JSONObject object=jsonArray.getJSONObject(i);
            SpecialRecommend specialRecommend=new SpecialRecommend();
            specialRecommend.ParseJSON(object);
            specialRecommends.add(specialRecommend);
        }
    }

    public int getRet() {
        return ret;
    }

    public List<SpecialRecommend> getSpecialRecommends() {
        return specialRecommends;
    }

}
